<?php require '../includes/security.php'; ?>
<?php require_once('../Connections/connection.php'); ?>
<?php
mysql_select_db($database_setroma, $setroma);

$id_stanza = $_GET['id_stanza'];


if ($_SESSION['status'] == "logged") {
	
$myFile = $_SERVER["DOCUMENT_ROOT"].$rootpath."userfiles/images/".GetSQLValue("select Immagine from oggetto where id_oggetto=".$_GET['id_oggetto']);

	
$query = "delete from oggetto where id_oggetto=".$_GET['id_oggetto'];
$risultato = mysql_query($query, $setroma) or die(mysql_error());
@unlink($myFile);
}

header("location: index.php?id_stanza=".$id_stanza); 

?>